<template>
  <div style="width: 300px; padding: 10px">
    <div class="top">
      <div>
        <span class="leix">项 </span>
        <span>{{ props.data.item.projectNo }} </span>
      </div>
      <span style="font-size: 12px; color: #ccc" @click="xiugai">{{ props.data._isshow ? "收起所有" : "展开所有" }}</span>
    </div>
    <div v-if="props.data._isshow">
      <hr />
      <div>
        <span>{{ props.data.item.projectName }}</span>
        <div style="display: flex; justify-content: space-between; margin-top: 5px">
          <div>
            <span>风险</span> <span style="color: #78b3e3">{{ props.data.item.projectDevRiskCount }}/{{ props.data.item.projectRiskCount }}</span>
          </div>
          <span class="colorBlue"
            >进度
            <div
              :style="{
                backgroundColor:
                  props.data.item.projectProgressState == 1 ? '#fa3b21' : props.data.item.projectProgressState == 2 ? 'yellow' : 'green'
              }"
              class="qiu"></div
          ></span>
          <span class="colorBlue"
            >质量
            <div
              :style="{
                backgroundColor: props.data.item.projectQualityState == 1 ? '#fa3b21' : props.data.item.projectQualityState == 2 ? 'yellow' : 'green'
              }"
              class="qiu"></div
          ></span>
          <span style="width: 20px; display: inline-block" @click="hide">-</span>
        </div>
      </div>
      <div v-if="props.data._isintel">
        <hr />
        <p>
          <span>团队({{ props.data.item.projectTeamCount }}) :</span>{{ props.data.item.projectTeamNames }}
        </p>
        <p>
          <span>项目负责人({{ props.data.item.projectLeaderCount }}) :</span>{{ props.data.item.projectLeaderNames }}
        </p>
        <p><span>所处阶段 :</span>{{ props.data.item.projectStageName }}</p>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, defineProps } from "vue";
const props = defineProps({
  data: {
    type: Object,
    default: () => ({})
  },
  modify: {
    type: Function,
    default: () => {}
  },
  hide: {
    type: Function,
    default: () => {}
  }
});
const xiugai = () => {
  props.modify();
};
const hide = () => {
  props.hide();
};
</script>
<style scoped>
.top {
  display: flex;
  justify-content: space-between;
}
hr {
  margin: 10px 0 !important;
}
.colorBlue {
  color: #78b3e3;
  display: flex;
  align-items: center;
}
.leix {
  background-color: #fbeceb;
  color: #de716e;
  display: inline-block;
  width: 22px;
  text-align: center;
  margin-right: 5px !important;
}
.qiu {
  width: 10px;
  height: 10px;
  background-color: #999999;
  border-radius: 50%;
  margin-left: 5px !important;
}
p {
  margin-bottom: 5px !important;
}
</style>
